﻿using System;

using Microsoft.WowAddonStudio.Lua.Loaders;
using Microsoft.WowAddonStudio.Lua.Model;

namespace Microsoft.WowAddonStudio.Lua.Tools.XmlDoc.Converters
{
    public static class TocLoader
    {
        public static Documentation LoadTocDocumentation(string tocPath)
        {
            if (tocPath == null)
                throw new ArgumentNullException("tocPath");

            var tocDocumentationLoader = new TocDocumentationLoader<FileStreamProvider>(new FileStreamProvider(tocPath));
            var documentationScope = tocDocumentationLoader.LoadDocumentation();
            return documentationScope.Documentation;
        }
    }
}
